{extend name='public/modal'}
{block name='content'}
<script src="/old/shipline_files/vue.js" type="text/javascript"></script>
<link href="/old/shipline_files/vant-2.9.min.css" rel="stylesheet"/>
<script src="/old/shipline_files/vant-2.9.min.js" type="text/javascript"></script>

<style>
    .flexBetween {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
</style>

<div class="layui-fluid lotus-form">
    <div class="layui-row">
        <form action="" class="layui-form layui-form-pane" id="lotus-add-form" method="post">

            <div class="layui-form-item">
                <label class="layui-form-label">订单号</label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" id="tc_order_no" lay-verify="required"
                           name="tc_order_no"
                           type="text" value="">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-filter="toSubmit" lay-submit="" style="margin-left: 20%">提交</button>
                    <button class="layui-btn layui-btn-primary" id="reset" type="reset">重置</button>
                </div>
            </div>

        </form>
    </div>
</div>


<script>
    layui.use(['laydate', 'form', 'upload', 'layer', 'jquery'], function () {
        var laydate = layui.laydate
            , upload = layui.upload
            , layer = layui.layer
            , $ = layui.jquery
            , form = layui.form;
        form.render();

        laydate.render({
            elem: '#push_time' //指定元素
            , type: 'datetime'
        });
        var uploadInst = upload.render({
            elem: '#cover_upload_btn' //绑定元素
            , url: '{:url("/index/login/upload")}'
            , size: 10240
            , accept: 'images'
            , multiple: true
            , auto: true
            , acceptMime: 'image/jpg, image/png'
            , done: function (res, index, upload) {
                // console.log(res);
                // img[img_num] = res.src;
                $(".cover_upload_img").html("");
                $("#pic_url").val(res.data.src);
                $(".cover_upload_img").append("<img style='width: 200px;' src='" + res.data.src + "'>");
                // console.log(img);
                layer.msg("上传成功", {icon: 6});
            }
            , error: function () {
                layer.msg("上传失败", {icon: 5});
            }
            , choose: function (obj) {
                layer.msg("正在上传...");
            }
        });


        form.on('select(province)', function (data) {
            var province = data.value; //得到被选中的值
            $.ajax({
                url: '{:url("admin/shiporder/shiporderlist")}',
                type: 'get',
                dataType: 'html',
                data: {province: province},
                success: function (e) {
                    $('#city').html(e);
                    $('#district').html('');
                    form.render('select');
                    console.log(e)
                }
            })
        });

        form.on('submit(*)', function (data) {
            console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });


    });
</script>

{/block}




